<?php
      @header("Content-Type:text/html;charset=utf-8");
      @header("Access-Control-Allow-Origin:*");
      $con=mysql_connect("localhost:3306","root","root");
    //   if($con){
    //       echo "true";
    //   }
      mysql_select_db("1904");
      mysql_query("set names utf8");//设置中文编码
      $result=mysql_query("select * from userinfo");
    //   print_r($result)//打不出来
      $all=array();
      while($row=mysql_fetch_row($result)){
        // print_r($row);
         $arr=array();
         $arr["user_id"]=$row[0];
         $arr["user_name"]=$row[1];
         $arr["user_pwd"]=$row[2];
         $arr["user_phone"]=$row[3];
         $all[]=$arr;
      }
      echo json_encode($all);
   
//    @header("content_type:text/html;charset=utf-8")s
?>